package com.example.service;

import com.example.dao.OutdepotDao;
import com.example.entity.Outdepot;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OutdepotService {

    @Resource
    private OutdepotDao outdepotDao;

    public void save(Outdepot outdepot){
        outdepotDao.save(outdepot);
    }

    public void del(Long id){
        outdepotDao.deleteById(id);
    }

    public Outdepot findById(Long id){
        return outdepotDao.findById(id).orElse(null);
    }

    public List<Outdepot> findAll(){
        return outdepotDao.findAll();
    }

    public void saveAll(List<Outdepot> outdepot){
        outdepotDao.saveAll(outdepot);
    }

}
